using System;
using SoftwareMonkeys.Scriptech.Entities;
using SoftwareMonkeys.Scriptech.Diagnostics;

namespace SoftwareMonkeys.Scriptech.Scripts
{
	public class ScriptProcess : BaseEntity
	{
		private string title = String.Empty;
		public string Title
		{
			get { return title; }
			set { title = value; }
		}
		
		private string output;
		public string Output
		{
			get { return output; }
			set { output = value; }
		}
		
		private bool isComplete;
		public bool IsComplete
		{
			get { return isComplete; }
			set { isComplete = value; }
		}
		
		private bool isError;
		public bool IsError
		{
			get { return isError; }
			set { isError = value; }
		}
		
		public void AppendOutput(string data)
		{
			using (LogGroup logGroup = LogGroup.StartDebug("Appending data to process."))
			{
				LogWriter.Debug("Data: " + data);
				LogWriter.Debug("Output: " + output);
				
				output = output + data;
				
				LogWriter.Debug("New output: " + output);
			}
		}
		
		private LogGroup logGroup = null;
		
		public ScriptProcess ()
		{
			logGroup = LogGroup.StartDebug("Constructing a ScriptProcess");
		}
	}
}

